<?php
        header("Content-type:text/html;charset=utf-8");
        $con = mysqli_connect("localhost", 'root', '', 'ksdb2');
        mysqli_set_charset($con, "utf8");
        
        $dpt_id = $_GET['dpt_id'];
        
        $dpt_name = $_GET['dpt_name'];
        
        

        $sql = "UPDATE department set dpt_name='$dpt_name' where dpt_id=$dpt_id;";
        
        
        // 执行插入语句
        if($con->query($sql))
        {
            echo "修改成功";
        //删完回去表页面
        }
        else{
            echo "修改失败";
        }
        
        // 回到首页
        header("location:department.php");
        mysqli_close($con);
    ?>

